import java.util.ArrayList;
import java.util.List;

class Person{

}
class Student extends Person{

}

public class TestDemo4 {
    public static void main(String[] args) {
        ArrayList<? super Person> list = new ArrayList<Person>();

        //最小粒度Person -> 添加的是Person或者Person的子类
        list.add(new Student());
        list.add(new Person());

    }
    public static void main_01(String[] args) {
        ArrayList<Integer> arrayList1 = new ArrayList<>();
        ArrayList<Double> arrayList2 = new ArrayList<>();

        List<? extends  Number> list = arrayList2;

        //List.add(1);   不适合写入

        Number a = list.get(0); //适合读取
    }
}
